import  re



def img_handle_elm(data):
    root = "https://fuss10.elemecdn.com"
    if not data:
        return None
    zimu = _re_fast_value("[a-z]+",data)
    shuzi = _re_fast_value("[0-9]+",data)
    if not all([zimu,shuzi]):
        return None

    result_list = [root]
    head_str = None
    if data.startswith(zimu):
        result_list.append(zimu)
        result_list.append(shuzi)
        head_str = zimu+shuzi
    elif data.startswith(shuzi):
        result_list.append(shuzi)
        result_list.append(zimu)
        head_str = shuzi + zimu
    else:
        return None

    other_data = data.replace(head_str,"")
    result_list.append(other_data)
    root_url = "/".join(result_list)

    imgType = other_data[-3:]
    if imgType == "peg":
        imgType = other_data[-4:]

    root_url = root_url + "." + imgType
    return root_url

def _re_fast_value(reStr,data):
    result = re.search(reStr,data)
    if not result:
        return None;
    return result.group();